//
//  HWSignCollectionViewCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/9/11.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWSignCollectionViewCell.h"

@interface HWSignCollectionViewCell()
@property(strong,nonatomic) UIImageView *icoimaView;
@property(strong,nonatomic) UILabel *dateLael;
@property(strong,nonatomic) UIView *xiantiaoView;
@end

@implementation HWSignCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame {
    
    if(self = [super initWithFrame:frame]) {
        
        [self setUpUI];
        
    }
    
    return  self;
    
}

- (void)setUpUI {
    
    self.icoimaView  = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 24*CFLScaleValue, 24*CFLScaleValue)];
    self.icoimaView.image = [UIImage imageNamed:@"sign_a"];
    [self addSubview: self.icoimaView];
    
    self.dateLael  = [[UILabel alloc]initWithFrame:CGRectMake(0,24*CFLScaleValue+11 , 24*CFLScaleValue, 8)];
    self.dateLael.text = @"09-01";
    self.dateLael.font = [UIFont systemFontOfSize:8];
    self.dateLael.textColor = [UIColor whiteColor];
    //   self.mingchenglabel.backgroundColor = [UIColor redColor];
    self.dateLael.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.dateLael];
    
    self.xiantiaoView = [[UIView alloc]initWithFrame:CGRectMake(24*CFLScaleValue,24*CFLScaleValue/2, 17*CFLScaleValue, 1)];
    self.xiantiaoView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.xiantiaoView];
    
    
}

-(void)setDatamodel:(HWQianDaoModel *)datamodel {
    
    _datamodel = datamodel;
   // signin_b
    
    if ([self.datamodel.sign isEqualToString:@"0"]) {
           self.icoimaView.image = [UIImage imageNamed:@"signin_b"];
    } else {
        
        
           self.icoimaView.image = [UIImage imageNamed:@"sign_a"];
        
    }
    
    

             
    
    
     self.dateLael.text =datamodel.t;
    
    
    BOOL   jingtian =   [WMUtil   checkTheDate:datamodel.time];
    
    if (jingtian) {
             
             
        self.dateLael.text = @"今日";
         
        
    }
    
    
}

@end
